﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Optimization;
using System.Web.Routing;
using System.Web.Security;
using CongregacaoOs.WebForm;

namespace CongregacaoOs.WebForm
{
    public class Global : HttpApplication
    {
        void Application_Start(object sender, EventArgs e)
        {
            
            // Code that runs on application startup
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterOpenAuth();
            RegisterRoutes(RouteTable.Routes);
            
        }
        

        void Application_End(object sender, EventArgs e)
        {
            //  Code that runs on application shutdown

        }

        void Application_Error(object sender, EventArgs e)
        {
            // Code that runs when an unhandled error occurs

        }

        void RegisterRoutes(RouteCollection routes) 
        {
            routes.MapPageRoute(
                "Home",
                "Cadastros/Home",
                "~/Cadastros/Home.aspx");

            routes.MapPageRoute(
                "Administracao", 
                "Cadastros/Administracao", 
                "~/Cadastros/adm.aspx");

            routes.MapPageRoute(
                "Cargos",
                "Cadastros/Cargos",
                "~/Cadastros/Cargo.aspx");

            routes.MapPageRoute(
                "Cidades",
                "Cadastros/Cidades",
                "~/Cadastros/Cidade.aspx");

            routes.MapPageRoute(
                "Distritais",
                "Cadastros/Distritais",
                "~/Cadastros/Distrital.aspx");

            routes.MapPageRoute(
                "Estados",
                "Cadastros/Estados",
                "~/Cadastros/Estado.aspx");

            routes.MapPageRoute(
                "Forum",
                "Cadastros/Forum",
                "~/Cadastros/ForumOS.aspx");

            routes.MapPageRoute(
                "Ordens de Servico",
                "Cadastros/OrdensDeServico",
                "~/Cadastros/GerenciamentoOS.aspx");

            routes.MapPageRoute(
                "Igrejas",
                "Cadastros/Igrejas",
                "~/Cadastros/Igreja.aspx");

            routes.MapPageRoute(
                "Paises",
                "Cadastros/Paises",
                "~/Cadastros/Pais.aspx");

            routes.MapPageRoute(
                "Regionais",
                "Cadastros/Regionais",
                "~/Cadastros/Regional.aspx");

            routes.MapPageRoute(
                "Relatorios",
                "Cadastros/Relatorios",
                "~/Cadastros/Relatorios.aspx");

            routes.MapPageRoute(
                "Usuarios",
                "Cadastros/Usuarios",
                "~/Cadastros/Servo.aspx");

            routes.MapPageRoute(
                "Agenda",
                "Cadastros/Agenda",
                "~/Cadastros/Agenda.aspx");

            routes.MapPageRoute(
                "Setores",
                "Cadastros/Setores",
                "~/Cadastros/Setor.aspx");

            routes.MapPageRoute(
                "TipoOS",
                "Cadastros/TipoOS",
                "~/Cadastros/TipoOS.aspx");
        }
    }
}
